<?php

namespace app\middleware;

use \yifang\middleware\Middleware_contract;

class LoginJump implements Middleware_contract
{
    /**
     *  处理请求
     */
    public function handle($request, \Closure $next)
    {
        //判断登录请求
        $loginData=app("P_BackendAccount")->getLoginData();
        if ($loginData["status"]) {
            header("content-type:text/html;charset=utf-8");
            echo getScriptContent(YIFANG_ROUTE_PREFIX."/");
            exit;
        }
        $response = $next($request);
        return $response;
    }
}


